'''
创建一个生成器方式一，元组生成式
g = (x * x for x in range(10))
print(g)  <generator object <genexpr> at 0x1022ef630>

创建一个生成器方式二,函数式yield(相当于一个return,每次执行完成之后从yield的代码开始执行)

def func()
    for i in range(10):
        yilld i
func().print  >>generator


for i in generator:
    print(s)
for _ in range(len(generator))
    print(next(generator))

'''
from collections.abc import Generator
print(isinstance(100,Generator))#判断一个


